import {
	httpGet,
	httpPost
} from "@/js_sdk/uni-admin/request"
var dpc = '/dpc';
var pc = dpc + '/pc';
var pay = dpc + '/pay';
var ai = dpc + '/ai';

export async function vsCode(data) {
	return await httpGet(dpc + "/vsCode", data);
}
export async function getinfo(data) {
	return await httpGet(dpc + "/users/getinfo", data);
}

export async function login(data) {
	return httpPost(pc + "/login", data);
}
export async function loginInfo(data) {
	return await httpGet(pc + "/loginInfo", data);
}

export async function userMenu(data) {
	return await httpGet(pc + "/userMenu", data);
}
export async function getAiDetails(url, data) {
	return await httpGet(ai + '/task/' + url, data);
}

// 获取会员等级
export async function getMember(data) {
	return await httpGet(pay + "/getMember", data);
}
// --- --- --- -- --- --- ----
// 添加用户余额
export async function addUserBalance(data) {
	return await httpPost(pc + "/addUserBalance", data);
}

// 添加用户会员
export async function addUserMember(data) {
	return await httpPost(pc + "/addUserMember", data);
}
// 添加用户余额
export async function addBalance(data) {
	return await httpPost(pc + "/addBalance", data);
}
// 用户禁用
export async function updateUserState(data) {
	return await httpPost(pc + "/updateUserState", data);
}
// 用户禁用
export async function updateState(data) {
	return await httpPost(pc + "/updateState", data);
}

// 用户列表
export async function getUserList(data) {
	return await httpPost(pc + "/getUserList", data);
}
// 修改用户
export async function updateUser(data) {
	return await httpPost(pc + "/updateUser", data);
}
// 用户添加
export async function addUser(data) {
	return await httpPost(pc + "/addUser", data);
}

// 用户余额减少
export async function reduceUserBalance(data) {
	return await httpPost(pc + "/reduceUserBalance", data);
}
// 用户余额减少
export async function reduceBalance(data) {
	return await httpPost(pc + "/reduceBalance", data);
}
// 删除用户
export async function delUser(data) {
	return await httpPost(pc + "/delUser", data);
}


// 修改用户余额
export async function updateBalance(data) {
	return await httpPost(pc + "/updateBalance", data);
}

// 统计收入和支出
export async function getIncomeAndExpenses(data) {
	return await httpPost(pc + "/getIncomeAndExpenses", data);
}
// Ai消耗比
export async function getAi(data) {
	return await httpPost(pc + "/getAi", data);
}

// 操作记录
export async function getOperateList(data) {
	return await httpPost(pc + "/getOperateList", data);
}
// 中币记录
export async function getRecordsList(data) {
	return await httpPost(pc + "/getRecordsList", data);
}
// AI记录
export async function getAiList(data) {
	return await httpPost(pc + "/getAiList", data);
}



// 退出登录
export async function logout(data) {
	return await httpPost(pc + "/logout", data);
}